package motionControl;

public class Position {

	int height;
	int width;
	int i=0;
	int[] vector = new int[2];

	public Position(int w, int he) {

		int width = w;
		int height = he;

	}

	public void calculate() {

		int x = vector[0];
		int y = vector[1];
		if (y < height / 3 & i != 1) {
			i = 1;
			TestBis.setValue(this.i);
			Thread th = new Thread(new TestBis());
			th.start();
		}

		if (y > (height / 3) * 2 & i != 2) {
			i = 2;
			TestBis.setValue(this.i);
			Thread th = new Thread(new TestBis());
			th.start();
		}

		if (x < width / 3 & i != 3) {
			i = 3;
			TestBis.setValue(this.i);
			Thread th = new Thread(new TestBis());
			th.start();
		}

		if (x > (width / 3) * 2 & i != 4) {
			i = 4;
			TestBis.setValue(this.i);
			Thread th = new Thread(new TestBis());
			th.start();
		}

	}

	public void setCalculate(HandRegistry h) {
		vector[0] = h.getX();
		vector[1] = h.getY();

	}

}
